package com.mybatis.dao;

import java.util.Map;

public class UserSql {
    //方法返回值一定是String类型，因为返回的是sql语句
    public String findByIds(Map<String, Object> map){
        Integer[] ids = (Integer[]) map.get("ids");

        String sql = "select * from user where id in(";
        for (Integer id : ids) {
            sql += id + ",";
        }
        sql = sql.substring(0, sql.length() - 1) + ")";
        return sql;
    }
}
